<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>房屋预约</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/renting/css/public.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/renting/css/layui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/header.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/bottom.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/landload_public.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/renting/css/landlord_appointment.css"/>
</head>
<body>
<div class="header">
    <div class="nav">
        <a href="${pageContext.request.contextPath}/renting/index.jsp" class="nav_title">好客租房</a>
        <select class="select">
            <option value="重庆">重庆</option>
            <option value="贵阳">贵阳</option>
            <option value="重庆">重庆</option>
            <option value="贵阳">贵阳</option>
        </select>
        <ul class="nav_ul">
            <li><a href="${pageContext.request.contextPath}/renting/index.jsp">首页</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/Findroom.jsp">轻松找房</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/entry.jsp">房东入驻</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/chat_news.jsp">消息</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/onther/login.jsp" style="color: #2981c8;">登录</a></li>
        </ul>
        <img src="${pageContext.request.contextPath}/renting/img/icon/lianxi-1.png" class="nav_img" style="margin-top: -20px;">
        <p class="nav_phone">
            <span>13301131116</span>
            <span>13301131116</span>
        </p>
    </div>
</div>
<div class="body">
    <div class="portrait_bg">
        <div class="portrait">
            <a href="../onther/personal.jsp">
                <img style="width: 100px;height: 100px;border-radius: 100%" src="../../img/${drom.avater}">
            </a>
        </div>
        <p class="nickname">我是房主</p>
    </div>
    <div class="content">
        <ul class="left_ul">
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/release.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >发布记录</a></li>
            <li class="li_active"><a href="${pageContext.request.contextPath}/renting/pages/landlord/appointment.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >房屋预约</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/arrange.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >房屋管理</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/order_processing.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >订单处理</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/collection.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的收藏</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/wallet.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >我的钱包</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/ID_verification.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >身份验证</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/contract.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >电子合同</a></li>
            <li><a href="${pageContext.request.contextPath}/renting/pages/landlord/about.jsp"><img src="${pageContext.request.contextPath}/renting/img/xuanzhongtiao.png" >联系我们</a></li>
        </ul>
        <div class="right_body">
            <div class="right_content">
                <div class="right_title">
                    <span>预约详情</span>
                    <span>预约时间</span>
                    <span>状态</span>
                    <span>操作</span>
                </div>
                <div id="addContent" class="right_main">

                </div>
                <div class="right_main">


                </div>
            </div>
            <div class="right_bottom">
                <div id="test1"></div>
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>
</div>
<div class="bottom">
    <p>沪公网安备 31011402005354号</p>
</div>
</body>
</html>
<script src="${pageContext.request.contextPath}/renting/js/jQuery-3.4.1.js"></script>

<script>
    $(function (){
        var txt={"userId":${drom.rid}};
        $.ajax({
            url:"${pageContext.request.contextPath}/userInfo/queryAppointByUserIdLimit?limit=3&page=1",
            type:"post",
            data:"condition="+JSON.stringify(txt),
            dataType:"JSON",
            success:(rs)=>{
                $.each(rs.list,function (i,j){
                    console.log(rs.data);

                    var str=j.appointment;
                    var a=str.split(" - ");
                    /*var appointment = j.appointment;
                    if(appointment!=null){
                        var date = new Date(appointment);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
                        Y = date.getFullYear() + '-';
                        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
                        D = date.getDate() + ' ';
                        appointment = Y+M+D;
                    }
                    alert(appointment);*/
                    var Listings=$(' <div class="item">' +
                    '<div class="item_img">' +
                    '<img src="${pageContext.request.contextPath}/renting/img/'+j.housePicture+'" >' +
                    '<div class="item_info">' +
                    '<p>'+j.communityName+'</p>' +
                    '<p>【'+j.name+'】'+j.communityAddress+'</p>' +
                    '<p>'+j.renovationCondition+'<span>'+j.houseType+'</span>'+j.towards+'</p>' +
                    '</div>' +
                    '</div>' +
                    '<div class="data">' +
                    '<p>'+a[0]+'</p></br>' +
                    '<p>'+a[1]+'</p>' +
                    '</div>' +
                    '<span>'+j.status+'</span>' +
                    '<span class="link"><a href="${pageContext.request.contextPath}/message/queryMessageByCondition?userId='+j.userId+'&landId=${drom1}">联系对方</a>' +
                        '<a href="${pageContext.request.contextPath}/userInfo/updateAppoin?rid='+j.appoinId+'">已看房</a>' +
                        '<a href="${pageContext.request.contextPath}/renting/pages/landlord/appointment_cancel.jsp?appoinId='+j.appoinId+'">取消预约</a></span>' +
                    '</div>');
                    Listings.appendTo("#addContent");
                })

            }
        });
    });

</script>
<script src="${pageContext.request.contextPath}/renting/layui.js"></script>
<script src="${pageContext.request.contextPath}/renting/js/landlord_public.js"></script>
<script src="${pageContext.request.contextPath}/renting/js/header.js"></script>
<script type="text/javascript">
    judge_login("${pageContext.request.contextPath}/renting/pages/landlord/release.jsp","${pageContext.request.contextPath}/renting/pages/onther/login.jsp");
</script>
<script src="${pageContext.request.contextPath}/renting/js/ScrollHolder.js"></script>